package top.lcm889.demo;

import java.util.concurrent.*;

/**
 * @author Coder-lcm
 * @date 2021/3/9
 */
public class MoreThread {
    public static void main(String[] args) {
        ThreadPoolExecutor threadPools = new ThreadPoolExecutor(2, 4, 60, TimeUnit.SECONDS, new LinkedBlockingDeque<>(10),Executors.defaultThreadFactory());
        for (int i = 0; i < 100; i++) {
            int finalI = i;
            threadPools.execute(new Runnable() {
                @Override
                public void run() {
                    System.out.println(Thread.currentThread().getName() + "--" + finalI);
                }
            });
        }
    }
}
